package com.shop.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.shop.dao.OrderDao;
import com.shop.domain.Order;
import com.shop.domain.User;
import com.shop.service.OrderService;

/**
 * 
 * @author wenjuanhenxing
 * @version V1.0 OrderServiceImpl.java 2016-4-4 下午12:41:40
 */
@Service("orderServiceImpl")
public class OrderServiceImpl implements OrderService {

	@Resource(name = "orderDaoImpl")
	private OrderDao orderDao;

	@Override
	public boolean addOrder(Order order) {
		return orderDao.addOrder(order);
	}

	@Override
	public Order getOrderById(Long id) {
		return orderDao.getOrderById(id);
	}

	@Override
	public List<Order> getOrderByCustomer(User user) {
		return orderDao.getOrderByCustomerId(user.getId());
	}

	@Override
	public List<Order> getOrderBySeller(User user) {
		return orderDao.getOrderBySellerId(user.getId());
	}

}
